/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    min-height: 100vh;
    color: #333;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Navigation sidebar */
.tools-nav {
    width: 240px;
    background: white;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    height: 100vh;
    position: sticky;
    top: 0;
}

.nav-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.nav-header h1 {
    font-size: 1.4em;
    color: #2196F3;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.nav-header .subtitle {
    font-size: 0.9em;
    color: #999;
    margin: 0;
}

.nav-tools {
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

/* 自定义滚动条样式 */
.nav-tools::-webkit-scrollbar {
    width: 6px;
}

.nav-tools::-webkit-scrollbar-track {
    background: transparent;
}

.nav-tools::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.nav-tools::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: #f6f9fe;
    color: #2196F3;
}

.nav-item.active {
    background: #f6f9fe;
    color: #2196F3;
    font-weight: 500;
}

.tool-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Main content area */
.tools-content {
    flex: 1;
    padding: 30px;
    background: #fff;
    position: relative;
    height: 100vh;
    overflow-y: auto;
}

/* Tool panels */
.tool-panel {
    display: none;
    max-width: 720px;
    margin: 0;
}

.tool-panel.custom-tool-panel {
    max-width: 100%;
}

.tool-panel.active {
    display: block;
}

.tool-header {
    margin-bottom: 25px;
}

.tool-header h2 {
    font-size: 1.6em;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.tool-description {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

.tool-body {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

/* QR Generator layout */
.qr-generator-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.qr-input-section {
    flex: 1;
    max-width: 360px;
}

/* Input group */
.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

input[type="text"] {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fafafa;
}

input[type="text"]:focus {
    border-color: #2196F3;
    outline: none;
    background: white;
}

.primary-button {
    height: 32px;
    padding: 0 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.primary-button:hover {
    background: #1976D2;
}

/* QR options */
.qr-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 4px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-label {
    font-size: 14px;
    color: #666;
    min-width: 80px;
}

input[type="color"] {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

select {
    height: 24px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

/* QR result section */
.qr-result-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-bottom: 60px;
}

#qrResult {
    min-height: 160px;
    min-width: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

#qrResult:empty {
    display: none;
}

#qrResult img {
    display: block;
    border-radius: 4px;
}

.download-button {
    position: absolute;
    bottom: 0;
    right: -12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    color: #2196F3;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.download-button:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.download-icon {
    font-size: 16px;
    line-height: 1;
}

.download-text {
    font-weight: 500;
}

/* 自定义工具样式 */
.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.custom-tools-section {
    padding: 0 10px;
}

.custom-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #888;
    font-size: 0.9em;
    padding: 0 5px;
}

.add-tool-btn {
    background: none;
    border: 2px dashed #ddd;
    color: #888;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.add-tool-btn:hover {
    color: #2196F3;
    border-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.05);
}

.custom-tool-item {
    width: 100%;
}

/* 对话框样式 */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.dialog-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dialog-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group input:hover {
    border-color: #d0d0d0;
    background: #f5f5f5;
}

.form-group input:focus {
    border-color: #2196F3;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.dialog-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #666;
}

.submit-btn {
    background-color: #2196F3;
    color: white;
}

.cancel-btn:hover {
    background-color: #eeeeee;
}

.submit-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

/* 自定义工具面板样式 */
.custom-tool-panel .tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-actions {
    display: flex;
    gap: 10px;
}

.remove-tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.remove-tool-btn:hover {
    opacity: 1;
}

.custom-tool-frame {
    width: 100%;
    height: calc(100vh - 150px);
    border: none;
    background: #fff;
}